<?php

namespace App\Http\Requests\Api\V1_0_0;

use Illuminate\Foundation\Http\FormRequest;

class CreditCardUpdateRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'id' => 'required',
            'bill_day' => 'required|date_format:"d"',
            'repayment_day' => 'required|date_format:"d"',
        ];
    }

    public function messages()
    {
        return [
            'id.required' => 'id不能为空',
            'bill_day.required' => '账单日不能为空',
            'bill_day.date_format' => '账单日格式不正确',
            'repayment_day.required' => '还款日不能为空',
            'repayment_day.date_format' => '还款日格式不正确',
        ];
    }
}
